function checkMobile(rule: any, value: string, callback: any): any {
    // 手机号正则表达式
    const regMobile =
        /^(13[0-9]|14[5|7]|15[0|1|2|3|4|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$/;
    if (regMobile.test(value)) {
        // 合法的手机号
        return callback();
    }
    callback(new Error("请输入合法的手机号"));
};
function checkEmail(rule: any, value: string, callback: any) {
    const regEmail = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
    if (regEmail.test(value)) {
        return callback();
    }
    callback(new Error("请输入合法的邮箱"));
};
function checkName(rule: any, value: string, callback: any) {
    const regEmail = /^[\u4e00-\u9fa5]+$/;
    if (regEmail.test(value)) {
        return callback();
    }
    callback(new Error("请输入2-5位全汉字名称"));
};
function checkMoney(rule: any, value: string, callback: any) {
    const regEmail = /^(([0-9]|([1-9][0-9]{0,9}))((\.[0-9]{1,2})?))$/;
    if (regEmail.test(value)) {
        return callback();
    }
    callback(new Error("请输入最多含有两位小数的金额"));
};
function checkNum(rule: any, value: string, callback: any) {
    const regEmail = /^[0-9]*$/;
    if (regEmail.test(value)) {
        return callback();
    }
    callback(new Error("请输入数量"));
};

export { checkMobile, checkEmail, checkName, checkMoney, checkNum }